package it.cums.model;

import java.beans.PropertyChangeListener;
import java.util.ArrayList;

public class Customer{
	private ArrayList<PropertyChangeListener> listeners = new ArrayList<PropertyChangeListener>();
	private int id;
	private String name;
	private String referencePerson;
	private String taxNumber;
	private String phone;
	private String mobilePhone;
	private String email;
	private String webSite;
	private String cap;
	private String location;
	private String address;
	private Country country;
	private String deliveryCap;
	private String deliveryLocation;
	private String deliveryAddress;
	private Country deliveryCountry;
	private String notes;
	private Orders orders;
	
	public Customer() {
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getLocation() {
		return location;
	}

	public void setLocation(String location) {
		this.location = location;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getEmail() {
		return email;
	}

	public void setWebSite(String webSite) {
		this.webSite = webSite;
	}

	public String getWebSite() {
		return webSite;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getPhone() {
		return phone;
	}

	public void setMobilePhone(String mobilePhone) {
		this.mobilePhone = mobilePhone;
	}

	public String getMobilePhone() {
		return mobilePhone;
	}

	public void setCap(String cap) {
		this.cap = cap;
	}

	public String getCap() {
		return cap;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getAddress() {
		return address;
	}

	public void setCountry(Country country) {
		this.country = country;
	}

	public Country getCountry() {
		return country;
	}

	public void setDeliveryCap(String deliveryCap) {
		this.deliveryCap = deliveryCap;
	}

	public String getDeliveryCap() {
		return deliveryCap;
	}

	public void setDeliveryLocation(String deliveryLocation) {
		this.deliveryLocation = deliveryLocation;
	}

	public String getDeliveryLocation() {
		return deliveryLocation;
	}

	public void setDeliveryAddress(String deliveryAddress) {
		this.deliveryAddress = deliveryAddress;
	}

	public String getDeliveryAddress() {
		return deliveryAddress;
	}

	public void setDeliveryCountry(Country deliveryCountry) {
		this.deliveryCountry = deliveryCountry;
	}

	public Country getDeliveryCountry() {
		return deliveryCountry;
	}

	public void setNotes(String notes) {
		this.notes = notes;
	}

	public String getNotes() {
		return notes;
	}

	public void setName(String name) {
		this.name = name;
		notifyListeners();
	}

	public String getName() {
		return name;
	}

	public void setReferencePerson(String referencePerson) {
		this.referencePerson = referencePerson;
	}

	public String getReferencePerson() {
		return referencePerson;
	}
	
	public void setTaxNumber(String taxNumber) {
		this.taxNumber = taxNumber;
	}

	public String getTaxNumber() {
		return taxNumber;
	}

	public Orders getOrders() {
		return orders;
	}
	
	public void setOrders(Orders orders) {
		this.orders = orders;
	}
	
	public String toString() {
		return name;
	}
	
	private void notifyListeners() {
		for (PropertyChangeListener listener : listeners) {
			listener.propertyChange(null);
		}
	}
	
	public void setPropertyChangeListeners(ArrayList<PropertyChangeListener> listeners) {
		this.listeners = listeners;
	}
}
